﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using XCore.Domain.Entities;
using XCore.Logger;

namespace SaaS.Model.Entity.Logs
{
    /// <summary>
    /// 工具API服务日志
    /// </summary>
    [Table("UtilLogs")]
    public class UtilLog : Entity<long>, IHasCreationTime
    {
        /// <summary>
        /// 等级
        /// </summary>
        public LoggerLevel Level { get; set; }
        /// <summary>
        /// 密钥
        /// </summary>
        [StringLength(64)]
        public string SecretKey { get; set; }
        /// <summary>
        /// 路径
        /// </summary>
        [Required]
        [StringLength(512)]
        public string Path { get; set; }
        /// <summary>
        /// 消息
        /// </summary>
        [Required]
        public string Message { get; set; }
        /// <summary>
        /// 执行时长(毫秒)
        /// </summary>
        public int Duration { get; set; }
        /// <summary>
        /// 异常
        /// </summary>
        public string Exception { get; set; }
        /// <summary>
        /// 自定义数据
        /// </summary>
        public string CustomData { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }

    }
}
